(function($){
	
    $(function(){
    	
		/**
		 * 奖品入库
		 */
		//G币奖品入库
        $('#storageGold').dialog({
            autoOpen: false,
            height: 300,
            width: 420,
            buttons: {
                '确定': function(){
                    $(this).dialog('close');
                },
				'取消': function(){
					$(this).dialog('close');
				}
            }
        });
		
		//经验值奖品入库
        $('#storageExperience').dialog({
            autoOpen: false,
            height: 300,
            width: 420,
            modal: true,
            buttons: {
                '确定': function(){
                    $(this).dialog('close');
                },
				'取消': function(){
					$(this).dialog('close');
				}
            }
        });
	        
		//实物奖品入库
        $('#storageVirtual').dialog({
            autoOpen: false,
            height: 300,
            width: 420,
            modal: true,
            buttons: {
                '确定': function(){
                    $(this).dialog('close');
                },
				'取消': function(){
					$(this).dialog('close');
				}
            }
        });
	        
		//虚拟点卡奖品入库
        $('#storageNoneVirtual').dialog({
            autoOpen: false,
            height: 300,
            width: 560,
            modal: true,
            buttons: {
                '确定': function(){
                    $(this).dialog('close');
                },
				'取消': function(){
					$(this).dialog('close');
				}
            }
        });
	        
		//奖品入库链接
		$('.storage_link').click(function(){
			var type = $(this).parents('td').siblings('td').eq(3).attr('value');
			switch (type) {
			case '1':
				//G币
				$('#storageGold').dialog('open');
				break;
			case '2':
				//经验值
				$('#storageExperience').dialog('open');
				break;
			case '3':
				//实物
				$('#storageVirtual').dialog('open');
				break;
			default:
				//虚拟物品
				$('#storageNoneVirtual').dialog('open');
			}
		});
		
		//追加奖品
        $('#add-more-award').dialog({
            autoOpen: false,
            height: 300,
            width: 420,
            modal: true,
            buttons: {
                '确定': function(){
                    $(this).dialog('close');
                },
                '取消': function(){
                    $(this).dialog('close');
                }
            }
        });
		
		$('.add-more-award-link').click(function(e){
            e.preventDefault();
            $('#add-more-award').dialog('open');
        });
        
    });

})(jQuery);